package main

import (
	"bufio"
	"fmt"
	"net"
)

func main() {

	// Connect to the socket:
	conn, err := net.Dial("tcp", ":10001")
	if err != nil {
		panic(err)
	}

	reader := bufio.NewReader(conn)
	for {
		// Listen for reply:

		if conn == nil {
			break
		}

		var errRead error
		time, errRead := reader.ReadString('\n')
		IP, errRead := reader.ReadString('\n')
		count, errRead := reader.ReadString('\n')

		if errRead != nil {
			panic(errRead)
		}

		fmt.Print(time)
		fmt.Print(IP)
		fmt.Println(count)
	}
	conn.Close()
}
